
#ifndef   __SIMPHONY_ANALOG_TO_DIGITAL_CONVERTOR
#define   __SIMPHONY_ANALOG_TO_DIGITAL_CONVERTOR

extern int ATD_Result;

/* ATD */
#define   PCAD					(1UL << 12)
#define   ATD_CLKDIV			8
#define   ATD_FREQ_MAX		4500000 /* Hz */
#define   ATD_CLKS			17
#define   ATD_PDN				(1UL << 21)
#define   ATD_START()		AD0CR|=(1UL<<24)
#define   ATD_RESULT()		((AD0GDR&0x80000000)?((AD0GDR&(0x3FF<<6))>>6):(-1))


void AnalogInit( void );
void Analog( void );
int ATD( int Channel);

//void Drive_Vin ( void );
void app_achans ( void );



#endif

